#ifndef __FILEREADER_H__
#define __FILEREADER_H__

#include <QObject>
#include <QDomDocument>
#include <QTreeWidget>

#include "datamodel.h"

class FileReader : public QObject
{
    Q_OBJECT
public:
    FileReader(const QString &fileName, QTreeWidget *treeWidget, Model *model);

    bool Read(QTreeWidget *treeWidget);
    

private :
    QDomDocument m_doc;
    QString m_fileName;
    Model *m_model;
          
    void ParseElement(const QDomElement &element, QTreeWidgetItem *parentItem, QTreeWidget *treeWidget);
    QTreeWidgetItem* createItem(const QDomElement &element, QTreeWidgetItem *parentItem);
};

#endif // __FILEREADER_H__
